<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:th="http://www.thymeleaf.org"
	xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
	layout:decorator="layouts/layout">
<head>
<title>Home</title>
</head>
<body>

	<th:block layout:fragment="content">
		<div class="container-wrapper">
			<div class="container">
				<div class="page-header">
					<h1>Order</h1>

					<p class="lead">Order confirmation</p>
				</div>

				<div class="container">

					<div class="row">

						<form th:object="${order}" th:action="${flowExecutionUrl}"  class="form-horizontal" method="POST">

							<div
								class="well col-xs-10 col-sm-10 col-md-6 col-xs-offset-1 col-sm-offset-1 col-md-offset-3">

								<div class="txt-center">
									<h1>Receipt</h1>
								</div>
								<div class="row">
									<div class="col-xs-6 col-sm-6 col-md-6">
										<address>
											<strong>Shipping Address</strong><br />
											<span th:text="${order.cart.customer.shippingAddress.streetname}"> </span> <br />
											<span th:text="${order.cart.customer.shippingAddress.city}"> </span>,
											<span th:text="${order.cart.customer.shippingAddress.state}"> </span> <br />
											<span th:text="${order.cart.customer.shippingAddress.country}"> </span>,
											<span th:text="${order.cart.customer.shippingAddress.zipcode}"> </span>
										</address>
									</div>
									<div class="col-xs-6 col-sm-6 col-md-6 text-right">
										<p>
											Shipping Date:
											
											<span th:text="${#dates.createNow()}"></span>
										</p>
									</div>
								</div>

								<div class="row">
									<div class="col-xs-6 col-sm-6 col-md-6">
										<address>
											<strong>Billing Address</strong><br />
											<span th:text="${order.cart.customer.billingAddress.streetname}"> </span> <br />
											<span th:text="${order.cart.customer.billingAddress.city}"> </span>,
											<span th:text="${order.cart.customer.billingAddress.state}"> </span> <br />
											<span th:text="${order.cart.customer.billingAddress.country}"> </span>,
											<span th:text="${order.cart.customer.billingAddress.zipcode}"> </span>
										</address>
									</div>
								</div>

								<div class="row">
									<table class="itable table-hover">
										<thead>
											<tr>
												<td>Product</td>
												<td>#</td>
												<td class="text-center">Price</td>
												<td class="text-center">Total</td>
											</tr>
										</thead>
										<tbody>
											
												<tr th:each="cartItem : ${order.cart.cartItems}">
													<td class="col-md-9"><em><span th:text="${cartItem.product.productName}"> </span></em></td>
													<td class="col-md-1" style="text-align: center"><span th:text="${cartItem.quantity}"> </span></td>
													<td class="col-md-1" style="text-align: center"><span th:text="${cartItem.product.productprice}"> </span></td>
													<td class="col-md-1" style="text-align: center"><span th:text="${cartItem.totalprice}"> </span></td>
												</tr>
											

											<tr>
												<td></td>
												<td></td>
												<td class="text-right">
													<h4>
														<strong>Grand Total:</strong>
													</h4>
												</td>
												<td class="text-center text-danger">
													<h4>
														<strong th:text="${order.cart.grandtotal}"></strong>
													</h4>
												</td>
											</tr>

										</tbody>
									</table>
								</div>


								<input type="hidden" name="_flowExecutionKey" /> <br />
								<br />

								<input type="submit" value="Back"
									class="btn btn-default" name="_eventId_backToCollectShippingDetail" />
								<input type="submit" value="Submit Order"
									class="btn btn-default" name="_eventId_orderConfirmed" />
								<input type="submit" value="Cancel"
									class="btn btn-default" name="_eventId_cancel" />

							</div>
						</form>
					</div>
				</div>
			</div>
		</div>

	</th:block>

</body>
</html>